package cn.zyx.controller;

import cn.zyx.Config.Result;
import cn.zyx.entity.Movie;
import cn.zyx.service.MovieService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.Query;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author zzp
 * @since 2022/1/26 20:59
 */
@RestController
@RequestMapping("message")
public class messageController {
    @Autowired
    MovieService movieService;


    @RequestMapping("ypp")
    public Result ypp(String type, Map<Object,Object> data){
        System.out.println(data);
        if (type.equals("0")){
            if((Integer) data.get("state")==4){
                //出票成功


            }else if ((Integer) data.get("state")==7||(Integer) data.get("state")==8){
                //出票失败


            }
        }

        if (type.equals("4")){
            if((Integer) data.get("state")==4){
                //出票成功


            }else if ((Integer) data.get("state")==7||(Integer) data.get("state")==8){
                //出票失败


            }
        }

        if (type.equals("5")){
            if((Integer) data.get("state")==4){
                //出票成功


            }else if ((Integer) data.get("state")==7||(Integer) data.get("state")==8){
                //出票失败


            }
        }


        Result result=new Result(200,"",null,0);

        return result;
    }

    @RequestMapping("kaquan")
    public String kaquan(HttpServletRequest request){


        return "ok";
    }

}
